ShellExcuteW Return
JpegAnalizer.Exe Test.jpg をShellExcute()で起動
String path=Parm[0]; //起動プログラムのDir+プログラム名
ExtractFilename(path); //Pathを抽出
path=path+ "\\JpegAna1\\JpegAnalyzer.exe"; //起動したいプログラムの文字列
wchar_t *text=new wchar_t[path.Length()]+2
wcscpy(text,path.c_str()); //String->wchar_tに変換
wchar_t *text1=new wchar_t[fName.Length()]+2; //引数( Test.Jpg )
wcscpy(text1,fName.c_str()); //String->wchar_tに変換
ShellExecuteW(0, L"open",text,text1 , NULL, SW_SHOW);
// ShellExecuteW(0, L"open", L"D:\\JpegAna1\\JpegAnalyzer.exe",L"D:\\Test.jpg" , NULL, SW_SHOW);
String をwchar_t に変換する方法がわからずなやみましたが、「E2034]’wchar_t *型は’const char *型に変換できない
の対処法の解説(Embracardero)を見つけ、上記の方法で動作しました。Delphiはサンプルがあり、PChar(LFile)でうごいたのですが
C++Builderではだめでした。